{extend name="../../base/view/common/base" /}
{block name="style"}
{include file="/approve/add_style" /}
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">通用审批</h3>
	{eq name="$id" value="0"}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">审批内容<font>*</font></td>
			<td colspan="2"><input type="text" name="name" value="" autocomplete="off" placeholder="请输入审批内容" lay-verify="required" lay-reqText="请输入审批内容" class="layui-input"></td>
			<td class="layui-td-gray">紧急程度<font>*</font></td>
			<td colspan="2">
				<select name="detail_type" lay-verify="required" lay-reqText="请选择">
				  <option value="">--请选择--</option>
				  <option value="1">普通</option>
				  <option value="2">紧急</option>
				  <option value="3">特急</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">详细描述<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入审批详细描述" class="layui-textarea" lay-verify="required" lay-reqText="请输入审批详细描述"></textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5" style="line-height:inherit">
				<div class="layui-row" id="fileList">
					<input type="hidden" data-type="file" name="file_ids" value="">
				</div>
			</td>
		</tr>
	</table>
	{else/}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">审批内容<font>*</font></td>
			<td colspan="2"><input type="text" name="name" value="{$detail.name}" autocomplete="off" placeholder="请输入审批内容" lay-verify="required" lay-reqText="请输入故障设备名称" class="layui-input"></td>
			<td class="layui-td-gray">紧急程度<font>*</font></td>
			<td colspan="2">
				<select name="detail_type" lay-verify="required" lay-reqText="请选择">
				  <option value="">--请选择--</option>
				  <option value="1" {eq name="$detail.detail_type" value="1"}selected=""{/eq}>普通</option>
				  <option value="2" {eq name="$detail.detail_type" value="2"}selected=""{/eq}>紧急</option>
				  <option value="3" {eq name="$detail.detail_type" value="3"}selected=""{/eq}>特急</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">详细描述<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入审批详细描述" class="layui-textarea" lay-verify="required" lay-reqText="请输入审批详细描述">{$detail.content}</textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5" style="line-height:inherit">
				<div class="layui-row" id="fileList">
					<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
					{notempty name="$detail.file_ids"}
					{volist name="$detail.fileArray" id="vo"}
					<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
					{/volist}
					{/notempty}
				</div>
			</td>
		</tr>
	</table>
	{/eq}
	{include file="/approve/add_flow" /}
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker','oaTool'];
	function gouguInit() {
		var form = layui.form,
			tool=layui.tool,
			oaTool=layui.oaTool,
			laydate = layui.laydate;
			
		oaTool.addFile({
			btn: 'upFile',
			box: 'fileList'
		});
		if (typeof (flowStep) == "function") {
			flowStep();
		}	
}
</script>
{/block}
<!-- /脚本 -->